Threading
The JDBC driver is completely thread safe; that is, it will not fail when database requests are made on separate threads.Threading Architecture
A JDBC driver can be based on one of the following architectures:
- Thread impaired. The JDBC driver serializes all JDBC calls. All requests are handled one by one, without concurrent processing.
- Thread per connection. The JDBC driver processes requests concurrently with statements that do not share the same connection; however requests on the same connection are serialized. The SequeLink for JDBC driver uses this architecture.
- Fully threaded. All requests use the threaded model. The JDBC driver processes all requests on multiple statements concurrently.
Cancelling Functions in Multithreaded Applications
In a multithreaded application, a thread can use the cancel method to cancel a statement that is being executed by another thread. Whether the cancel method actually cancels the statement depends on the data store being accessed as shown in Table 8-2.
In both cases, the cancel method returns
SQL_SUCCESS. If the cancel method has been called from a different thread while a request is pending, the original statement will returnSQL_ERRORwith the error messageOperation cancelled.